<?php
 /** @see Div_Db_Distributor_Strategy_RSS_Abstract */
require_once('Div/Db/Distributor/Strategy/Abstract.php');

/**
 * Abstract RSS Strategy class
 * 
 * RSS strategy is an example - shows that strategies could operate on every data source, not
 * only on relational databases
 * @package    Div_Db_Distributor_Strategy_RSS
 * @copyright  Copyright (c) 2008 Ganglib project members (http://www.code.google.com/p/ganglib)
 * @license     http://www.gnu.org/licenses/lgpl.html
 */
abstract class Div_Db_Distributor_Strategy_RSS_Abstract extends Div_Db_Distributor_Strategy_Abstract
{	
	/**
	 * Query distribution method.
	 * This is strategy specific.
	 *
	 * @param Div_Db_Query $query
	 * @return mixed
	 * @access public
	 */
	public function distributeQuery(Div_Db_Query $query)
	{
		return null;
	}
	
	/**
	 * Connect to database using schema from config
	 *
	 * @param strign $schema
	 * @return PDO
	 * @access public
	 */
	public function connect($schema)
	{
		return true;
	}
	
	/**
	 * Checks if query is SELECT (since we don't want to cache updates etc.)
	 *
	 * @param Div_Db_Query $query
	 * @return bool
	 * @access public
	 */
	public function queryIsSelect(Div_Db_Query $query)
	{
		$modelArray = $query->toModelArray();
		return $modelArray['type'] == Div_Db_Query::QUERY_SELECT ? true : false;
	}
}